package com.zfx.mapper;

import com.zfx.pojo.Level1System;
import org.apache.ibatis.annotations.Select;
import tk.mybatis.mapper.common.Mapper;

import java.util.List;

/**
 * @description:
 * @author: zfx
 * @version: 1.0
 * @time: 2020-05-10 15:06
 * <p>
 * 修改历史：
 * 修改日期      修改人员    版本    内容
 * 2020-05-10   zfx       1.0
 */
public interface ILevel1SystemMapper extends Mapper<Level1System> {


    @Select("<script>select l.level1SystemId, l.state, l.projectName, l.customerName, l.createDate, l.deliveryDate, u.username " +
            "from tbs_level_1_system l " +
            "left join tbs_user u on l.userId = u.userId " +
            "where l.state like #{state}" +
            "<if test='createDate != null'> and l.createDate &gt; #{createDate}</if>" +
            "<if test='deliveryDate != null'> and l.deliveryDate &lt;= #{deliveryDate}</if>" +
            "<if test='projectName != null'> and l.projectName like #{projectName}</if>" +
            "<if test='username != null'> and u.username like #{username}</if></script>")
    public List<Level1System> findByLevel1System(Level1System level1System);

}
